package 周赛;

public class 股票平滑下跌的数目 {
    public long getDescentPeriods(int[] prices) {
         long res = 1;
         int cur = 1;
        for (int i = 1; i < prices.length; i++) {
            if (prices[i]==prices[i-1]-1)
                cur++;
            else
                cur=1;
            res+=cur;
        }
        return res;
    }
}
